package com.mucd.chat.controller;

import com.mucd.chat.service.MessageRecordService;
import com.ruoyi.common.core.domain.MessageRecord;
import com.ruoyi.common.core.domain.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author mucd
 */
@RestController
@RequestMapping("messageRecord")
public class MessageRecordController {

    @Resource
    private MessageRecordService recordService;

    @PostMapping("selectMessageRecord")
    public R<?> selectMessageRecord(@RequestBody MessageRecord mr) {
        return R.ok(recordService.
                selectListBySendUserIdAndReceiveUserId
                        (mr.getSendUserId(), mr.getReceiveUserId()));
    }


}